<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class GivedGift extends Model
{
    protected $table = 'gifts';

    protected $guarded = [];

    public $timestamps = false;


    // 送礼用户
    public function sendUser(){

        return $this->belongsTo(User::class,'uid','id');

    }

    // 收礼用户
    public function getUser(){

        return $this->belongsTo(User::class,'gifts_uid','id');

    }

    public function gift(){

        return $this->belongsTo(Gift::class,'gift_id','id');
    }

    public function book(){

        return $this->belongsTo(Book::class,'relation','book_num');


    }

}
